home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / g_man / cat3 / standard / linesmooth.z / linesmooth
Encoding:
Text File  |  1998-10-20  |  9.5 KB  |  265 lines

  1.  
  2.  
  3.  
  4. lllliiiinnnneeeessssmmmmooooooootttthhhh((((3333GGGG))))                                                  lllliiiinnnneeeessssmmmmooooooootttthhhh((((3333GGGG))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      lllliiiinnnneeeessssmmmmooooooootttthhhh - specify antialiasing of lines
  10.  
  11. CCCC SSSSPPPPEEEECCCCIIIIFFFFIIIICCCCAAAATTTTIIIIOOOONNNN
  12.      vvvvooooiiiidddd lllliiiinnnneeeessssmmmmooooooootttthhhh((((mmmmooooddddeeee))))
  13.      uuuunnnnssssiiiiggggnnnneeeedddd lllloooonnnngggg mmmmooooddddeeee;;;;
  14.  
  15. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  16.      _m_o_d_e   expects one of two values:
  17.  
  18.             SSSSMMMMLLLL____OOOOFFFFFFFF, defeats antialiasing of lines (default).
  19.  
  20.             SSSSMMMMLLLL____OOOONNNN enables antialiasing of lines.  SSSSMMMMLLLL____OOOONNNN can be modified by
  21.             either or both of two additional symbolic constants:
  22.  
  23.             SSSSMMMMLLLL____SSSSMMMMOOOOOOOOTTTTHHHHEEEERRRR indicates that a higher quality filter should be used
  24.             during line drawing.  This filter typically requires that more
  25.             pixels be modified, and therefore potentially reduces the rate at
  26.             which antialiased lines are rendered.
  27.  
  28.             SSSSMMMMLLLL____EEEENNNNDDDD____CCCCOOOORRRRRRRREEEECCCCTTTT indicates that the endpoints of antialiased lines
  29.             should be trimmed to the exact length specified by the subpixel
  30.             position of each line.
  31.  
  32.      The constants SML_SMOOTHER and SML_END_CORRECT are specified with SSSSMMMMLLLL____OOOONNNN
  33.      by bitwise ORing them, or by adding them.  For example,
  34.  
  35.           linesmooth(SML_ON + SML_SMOOTHER + SML_END_CORRECT);
  36.  
  37.  
  38.      enables antialiased line drawing with the highest quality, and
  39.      potentially lowest performance, algorithm.  These modifiers are hints,
  40.      not directives, and are therefore ignored by systems that do not support
  41.      the requested feature.
  42.  
  43.  
  44.  
  45.  
  46.  
  47. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  48.      Antialiased lines can be drawn in both color map and RGB modes.
  49.      lllliiiinnnneeeessssmmmmooooooootttthhhh controls this capability.  In both modes, for antialiased
  50.      lines to draw properly:
  51.  
  52.           +o    linestyle must be 0xFFFF,
  53.           +o    lsrepeat must be 1.
  54.  
  55.      For color map antialiased lines to draw correctly, a 16-entry colormap
  56.      block (whose lowest entry location is a multiple of 16) must be
  57.      initialized to a ramp between the background color (lowest index) and the
  58.      line color (highest index).  Before drawing lines, clear the area to the
  59.      background color.
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. lllliiiinnnneeeessssmmmmooooooootttthhhh((((3333GGGG))))                                                  lllliiiinnnneeeessssmmmmooooooootttthhhh((((3333GGGG))))
  71.  
  72.  
  73.  
  74.      The linesmooth hardware replaces the least significant 4 bits of the
  75.      current color index with bits that represent pixel coverage.  Therefore,
  76.      by changing the current color index (only the upper 8 bits are
  77.      significant) you can select among many 16-entry color ramps, representing
  78.      different colors and intensities.  You can draw depthcued, antialiased
  79.      lines in this manner.
  80.  
  81.      The z-buffer hardware can be used to improve the quality of color map
  82.      antialiased line images.  Enabled in the standard depth-comparison mode,
  83.      it ensures that lines nearer the viewer obscure more distant lines.
  84.      Alternately, the z-buffer hardware can be used to compare color values by
  85.      issuing:
  86.  
  87.           zbuffer(TRUE);
  88.           zsource(ZSRC_COLOR);
  89.           zfunction(ZF_GREATER);
  90.  
  91.  
  92.      Pixels are then replaced only by 'brighter' values, resulting in better
  93.      intersections between lines drawn using the same ramp.
  94.  
  95.      RGB antialiased lines can be drawn only on machines that support
  96.      blending.  For these lines to draw correctly, the blendfunction must be
  97.      set to merge new pixel color components into the framebuffer using the
  98.      incoming (source) alpha values.  Incoming color components should always
  99.      be multiplied by the source alpha (BF_SA).  Current (destination) color
  100.      components can be multiplied either by one minus the source alpha
  101.      (BF_MSA), resulting in a weighted average blend, or by one (BF_ONE),
  102.      resulting in color accumulation to saturation; issue:
  103.  
  104.           blendfunction(BF_SA, BF_MSA); /* weighted average */
  105.  
  106.  
  107.      or
  108.  
  109.           blendfunction(BF_SA, BF_ONE); /* saturation */
  110.  
  111.  
  112.      The linesmooth hardware scales incoming alpha components by an 8-bit
  113.      computed coverage value.  Therefore reducing the incoming source alpha
  114.      results in transparent, antialiased lines.
  115.  
  116.      RGB antialiased lines draw correctly over any background image.  It is
  117.      not necessary to clear the area in which they are to be drawn.
  118.  
  119.      Both color map and RGB mode antialiased lines can be drawn with
  120.      subpixel-positioned vertexes (see ssssuuuubbbbppppiiiixxxxeeeellll).  Subpixel positioning of
  121.      line vertexes results in higher quality lines.  On some models subpixel
  122.      positioning may reduce performance.
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. lllliiiinnnneeeessssmmmmooooooootttthhhh((((3333GGGG))))                                                  lllliiiinnnneeeessssmmmmooooooootttthhhh((((3333GGGG))))
  137.  
  138.  
  139.  
  140.      The width of antialiased lines is controlled by lllliiiinnnneeeewwwwiiiiddddtttthhhh and lllliiiinnnneeeewwwwiiiiddddtttthhhhffff....
  141.      Although line width can be arbitrarily specified, only a small, hardware
  142.      specific number of line widths is actually supported.  (Refer to the
  143.      lllliiiinnnneeeewwwwiiiiddddtttthhhh manpage.)
  144.  
  145.      The modifier SML_SMOOTHER can be ORed or ADDed to the symbolic constant
  146.      SML_ON when antialiased lines are enabled.  When this is done, a higher
  147.      quality and potentially lower performance filter is used to scan convert
  148.      antialiased lines.  SML_SMOOTHER is a hint, not a directive.  Thus a
  149.      higher quality filter is used only if it is available.
  150.  
  151.      The modifier SML_END_CORRECT can ba ORed or ADDed to the symbolic
  152.      constant SML_ON when antialiased lines are enabled.  When this is done,
  153.      the endpoints of antialiased lines are scaled to the exact length
  154.      specified by their subpixel-positioned endpoints, rather than drawn to
  155.      the nearest integer length.  SML_END_CORRECT is a hint, not a directive.
  156.      Thus antialiased lines are drawn with corrected endpoints only if support
  157.      is available in the hardware.
  158.  
  159. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  160.      bgnline, blendfunction, deflinestyle, linewidth, lsrepeat, pntsmooth,
  161.      setlinestyle, subpixel, v, zbuffer, zfunction, zsource
  162.  
  163. NNNNOOOOTTTTEEEESSSS
  164.      This subroutine does not function on IRIS-4D B or G models.
  165.  
  166.      IRIS-4D GT and GTX models, as well as the Personal Iris, Personal Iris
  167.      Turbo and Iris Entry, do not support SML_SMOOTHER and SML_END_CORRECT.
  168.      Both hints are ignored on these systems.
  169.  
  170.      XS, XS24, XZ, Elan and Extreme systems do not support SML_SMOOTHER
  171.  
  172.      On Iris Entry, Personal Iris, and Personal Iris Turbo lllliiiinnnneeeessssmmmmooooooootttthhhh support
  173.      is only valid for color index mode.  Personal Iris and Personal Iris Tur-
  174.      bo require that subpixel positioning is enabled when drawing smooth
  175.      lines.
  176.  
  177.      IRIS-4D VGX models adjust the antialiasing filter for each line based on
  178.      its slope when SML_SMOOTHER is requested.  They support SML_END_CORRECT
  179.      only in RGB mode.
  180.  
  181. BBBBUUUUGGGGSSSS
  182.      On the IRIS-4D GT and GTX models ZSRC_COLOR z-buffering is supported only
  183.      for non-subpixel positioned color map mode lines.
  184.  
  185.      Before ZSRC_COLOR z-buffering is used on IRIS-4D GT and GTX models, bit-
  186.      planes 12 through 23 must be explicitly cleared to zero.  This must be
  187.      done in RGB mode, with a code sequence such as:
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. lllliiiinnnneeeessssmmmmooooooootttthhhh((((3333GGGG))))                                                  lllliiiinnnneeeessssmmmmooooooootttthhhh((((3333GGGG))))
  203.  
  204.  
  205.  
  206.           RGBmode();
  207.           doublebuffer();
  208.           gconfig();
  209.           frontbuffer(TRUE);
  210.           cpack(0);
  211.           clear();
  212.           cmode();
  213.           frontbuffer(FALSE);
  214.           gconfig();
  215.           _b_o_d_y _o_f _p_r_o_g_r_a_m
  216.  
  217.  
  218.      The clear operation must be repeated only after bitplanes 12 through 23
  219.      are modified, which can result only from interaction with another window
  220.      running in RGB mode.
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.